﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="searchResult.aspx.vb" Inherits="Prototype.searchResult" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" DataKeyNames="ID">
        <Columns>
        <asp:TemplateField HeaderText="Photo">
                    <ItemTemplate>
                        <asp:HyperLink ID="bb" runat="server" NavigateUrl='<%# Eval("ID","~/Details.aspx?ID={0}") %>' Width="200px" Height="200px">
                            <asp:Image ID="aa" runat="server" ImageUrl='<%# Eval("Picture") %>'  Width="200px" Height="200px"/></asp:HyperLink>
                    </ItemTemplate>
                    <ControlStyle Height="200px" Width="200px" />
                </asp:TemplateField>
            <asp:BoundField DataField="Bookname" HeaderText="Bookname" 
                SortExpression="Bookname" />
            <asp:BoundField DataField="Author" HeaderText="Author" 
                SortExpression="Author" />
            
            <asp:BoundField DataField="Series" HeaderText="Series" 
                SortExpression="Series" />
            
        </Columns>
        <EmptyDataTemplate>
            No Data Found
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:booksConn %>" 
        ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
        
        SelectCommand="SELECT [ID], [Bookname], [Author], [Series], [Picture] FROM [books] WHERE (([Bookname] LIKE '%' + ? + '%') OR ([Series] LIKE '%' + ? + '%') OR ([Author] LIKE '%' + ? + '%'))">
        <SelectParameters>
            <asp:QueryStringParameter Name="Bookname" QueryStringField="Value" 
                Type="String" />
            <asp:QueryStringParameter Name="Series" QueryStringField="Value" 
                Type="String" />
            <asp:QueryStringParameter Name="Author" QueryStringField="Value" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
